#!/bin/bash
if [ $# -lt 1 ]
 then
  echo "args is error!!!" 
  exit
fi

#循环操作每台机器的zk
for host in hadoop202 hadoop203 hadoop204
do
 case $1 in
  "start")
   echo "===============start $host zookeeperServer==============="
   ssh $host /opt/module/zookeeper-3.5.7/bin/zkServer.sh $1
  ;;
  "stop")
   echo "===============stop $host zookeeperServer==============="
   ssh $host /opt/module/zookeeper-3.5.7/bin/zkServer.sh $1
  ;;
  "status")
   echo "===============status $host zookeeperServer==============="
   ssh $host /opt/module/zookeeper-3.5.7/bin/zkServer.sh $1
  ;;
  *)
   echo "args is error!!!"
   exit
  ;;
 esac
done

